<template>
	<view v-if="dvList.length === 0">
		开发中...
		<image style="width: 400rpx;height: 400rpx; position: absolute; left: 20%; top:20%"
		    src="https://tj-1305380059.cos.ap-nanjing.myqcloud.com/pic/wujilu.png" mode=""></image>
	</view>
<!-- 	<view v-else>
		<uni-card v-for="(item,index) in dvList" :key="index" :title="item.studentName" :extra="item.className">
			<view v-if="item.violationImg != null && item.violationImg != ''">
				<image style="width: 100%;" :src="item.violationImg" @click="imgClick(item.violationImg)"></image>
			</view>
			<view>  
				<text>违纪时间：{{ item.violationTime }}</text>  
			</view>  
			<view>
				<text>违纪内容：{{ item.violationContent }}</text>  
			</view>
			<view>
				<text>处理内容：{{ item.dealContent }}</text>  
			</view>
		</uni-card>
	</view> -->
</template>

<script>
	import parent from '@/api/modules/parent';
	
	
	export default {
		data() {
			return {
				studentId : uni.getStorageSync("loginId"),
				dvList : [],
				dvAreaList:[
					{"1":"班级"},
					{"2":"宿舍"},
					{"3":"校园内"}
				],
				dvtypeList:[
					{"1":"着装"},
					{"2":"睡觉"},
					{"3":"玩游戏"},
					{"4":"外出"},
					{"5":"抽烟"},
					{"6":"其他"},
					{"7":"迟到"},
					{"8":"未戴校牌"},
					{"9":"未穿校服"},
					{"10":"携带外卖"},
					{"11":"校园抽烟"},
					{"12":"打架斗殴"},
					{"13":"饮酒酗酒"},
					{"14":"打牌赌博"},
					{"15":"翻爬围墙"},
					{"16":"谩骂他人"},
					{"17":"携带违禁品"},
					{"18":"宿舍抽烟"},
				]
			}
		},
		created() {
			// uni.showToast({
			// 	title: '开发中...',
			// 	icon: "info"
			// })
			// this.loadData();
		},
		methods: {
			loadData() {
				uni.showLoading({
					mask: true,
					title: '加载中'
				});
				parent.getParenChildDv(this.studentId).then(res => {
					uni.hideLoading();
					console.log("学生违纪信息：",res.data)
					this.dvList=res.data
				}).catch(err => {
					uni.hideLoading();
					console.log("学生违纪信息：",err)
				})
			},
			getArea(val){
				for(let i=0;i<this.dvAreaList.length;i++){
					for(var key in this.dvAreaList[i]){
						if(key==val){
							return this.dvAreaList[i][key]
						}
					}
				}
			},
			getDvType(val){
				for(let i=0;i<this.dvtypeList.length;i++){
					for(var key in this.dvtypeList[i]){
						if(key==val){
							return this.dvtypeList[i][key]
						}
					}
				}
			},
		}
	}
</script>

<style>
</style>
